<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ page import="org.openflashchart.Graph"%>
<%@ page import="org.openflashchart.Bar"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.text.NumberFormat"%>
<%@page import="com.ejoysoft.wlanyz.business.ThreeNet"%>
<%@ include file="../include/jsp/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<%
    String  strStartTime = ParamUtil.getString(request,"strStartTime","");
    String  strEndTime = ParamUtil.getString(request,"strEndTime","");
    String strCity = globa.city;
    String strTown = globa.hotpot;
    //System.out.println("HHHHHHHHHHHHHHHHHHHHH");
    double nummax = 0;
    String twhere = " where 1 = 1 ";
    if(!strCity.equals("")){
    twhere+=" and a.strcity = '"+ strCity +"' ";
    }
    if(!strTown.equals("")){
    twhere+=" and a.strTown LIKE '%"+ strTown +"%' ";
    }
    if(strStartTime.equals(""))strStartTime = "1000-1-01";
    if(strEndTime.equals(""))strEndTime = "9999-12-30";
    twhere+=" and c.dtcreatdate between to_date('" + strStartTime + "','yyyy-MM-dd hh24.mi.ss') and to_date('" + strEndTime + "','yyyy-MM-dd hh24.mi.ss') ";
    ThreeNet obj = new ThreeNet(globa);
    double[] webOnList1 = obj.getRateIndexAvg(twhere,"WLAN");//wlan指标均值
    double[] webOnList2 = obj.getRateIndexAvg(twhere,"TD");//wlan指标均值
    double[] webOnList3 = obj.getRateIndexAvg(twhere,"GSM");//wlan指标均值
	//NumberFormat nt = NumberFormat.getPercentInstance();
	Graph g = new Graph();
	Bar b = new Bar("50", "#B0C4DE");
	Bar b2 = new Bar("50", "#0000FF");
	Bar b3 = new Bar("50", "#FFD700");
	b.key("wlan", 15);
	b2.key("td", 15);
	b3.key("gsm", 15);
	//List<String> links = new ArrayList<String>();
	//int max = 50;
	
	for(int i = 0; i < webOnList1.length; i++) {
		b.add(String.valueOf(webOnList1[i]/100), "");
		b2.add(String.valueOf(webOnList2[i]/100), "");
		b3.add(String.valueOf(webOnList3[i]/100), "");
		if(nummax<webOnList1[i]){
		nummax = webOnList1[i];
		}
		if(nummax<webOnList2[i]){
		nummax = webOnList2[i];
		}
		if(nummax<webOnList3[i]){
		nummax = webOnList3[i];
		}
	}
	
	//小数点后面最多显示几位
	//nt.setMinimumFractionDigits(2);
	
	
	// Spoon sales, March 2007
	g.title("客户感知", "{font-size: 26px;}");
	g.getData_sets().add(b);
	g.getData_sets().add(b2);
	g.getData_sets().add(b3);
	g.bar("0");
	g.bar("0");
	g.bar("0");
	
	// label each point with its value
	List<String> labels = new ArrayList<String>();
	labels.add("AP关联成功率");
	labels.add("WEB认证成功率");
	labels.add("WEB下线成功率");
	labels.add("PEAP认证成功率");
	labels.add("PEAP下线成功率");
	labels.add("HTTP请求成功率");
	labels.add("PING成功率");
	labels.add("FTP上行成功率");
	labels.add("FTP下行成功率");
	labels.add("用户隔离成功率");
	labels.add("用户漫游成功率");
	g.set_x_labels(labels);
	g.set_x_label_style("10", "#006699", 0, 0, "");
	g.set_x_axis_steps(1);
	g.set_x_tick_size(5);
	g.set_bg_colour("#eaf7fc");

	//g.set_y_right_label_style("12", "#006699");
	//g.attach_to_y_right_axis(labels);//添加y右坐标轴
	g.set_y_max(1);
	g.set_y_min(0);
	//g.set_y_right_max(50);
	//g.set_y_right_min(-50);
	g.y_label_steps(10);
	g.set_tool_tip("#val#<br>");
%>
<%=g.render()%>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>